package opgave2;

public class Pair<K extends Data, V extends Clonable> implements Data {
	K key;
	V value;
	
	Pair(K key, V value) {
		this.key = key;
		this.value = value;
	}
	
	public int compareTo(Object o) {
		Pair<K, V> pair = (Pair<K, V>)o;
		return key.compareTo(pair.key);
	}
	
	public Pair<K, V> clone() {
		K newKey = (K)key.clone();
		V newValue = (V)value.clone();
		Pair<K, V> result = new Pair(newKey, newValue);
		
		return result;
	}
}